package com.liao.badminton.vo;

import com.liao.badminton.code.BaseField;
import io.swagger.annotations.ApiModelProperty;
import java.lang.String;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.entity.SystemMenu;
/**
* @author liaocheng
* @date 2024-11-01
* description:菜单权限表
*/
@Data
public class SystemMenuVo  extends BaseField {

    @ApiModelProperty(value = "菜单ID")
    private Long id;

    @ApiModelProperty(value = "菜单名称")
    private String name;

    @ApiModelProperty(value = "权限标识")
    private String permission;

    @ApiModelProperty(value = "菜单类型")
    private Integer type;

    @ApiModelProperty(value = "显示顺序")
    private Integer sort;

    @ApiModelProperty(value = "父菜单ID")
    private Long parentId;

    @ApiModelProperty(value = "路由地址")
    private String path;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "组件路径")
    private String component;

    @ApiModelProperty(value = "组件名")
    private String componentName;

    @ApiModelProperty(value = "菜单状态")
    private Integer status;

    @ApiModelProperty(value = "是否可见")
    private Integer visible;

    @ApiModelProperty(value = "是否缓存")
    private Integer keepAlive;

    @ApiModelProperty(value = "是否总是显示")
    private Integer alwaysShow;

    private List<Long> delIds;  //批量删除ids

    public static SystemMenuVo invertToVo(SystemMenu systemMenu){
        SystemMenuVo vo = new SystemMenuVo();
        BaseField.invert(systemMenu, vo);
        vo.setId(systemMenu.getId());
        vo.setName(systemMenu.getName());
        vo.setPermission(systemMenu.getPermission());
        vo.setType(systemMenu.getType());
        vo.setSort(systemMenu.getSort());
        vo.setParentId(systemMenu.getParentId());
        vo.setPath(systemMenu.getPath());
        vo.setIcon(systemMenu.getIcon());
        vo.setComponent(systemMenu.getComponent());
        vo.setComponentName(systemMenu.getComponentName());
        vo.setStatus(systemMenu.getStatus());
        vo.setVisible(systemMenu.getVisible());
        vo.setKeepAlive(systemMenu.getKeepAlive());
        vo.setAlwaysShow(systemMenu.getAlwaysShow());
        return vo;
    }
}
